1. Field of the Invention
The present invention relates to a stereoscopic image processing apparatus. More particularly, the present invention relates to a stereoscopic image processing apparatus in which so-called stereo matching is performed using a variable size of the small image region and to the method of such stereo matching.
2. Discussion of Related Arts
In recent years, a stereoscopic image processing apparatus for calculating a distance to an object using a pair of picture images, has been put to practical use. The stereoscopic image processing apparatus calculates a positional deviation between a pair of images of an object, namely, a parallax. In calculating the parallax, a plurality of small image regions, that is, pixel blocks are provided in a lateral line on one reference image and the other comparison image, respectively and groups of pixel blocks positionally corresponding to each other are picked up from one frame of picture image (stereo matching) and a group of parallaxes is calculated for every frame of picture image. Distance data corresponding to each coordinate position of the picture image are calculated from the parallaxes.
In evaluating the correlation of brightness characteristic between reference and comparison pixel blocks, as disclosed in Japanese Patent Laid-open No. Toku-Kai 2002-267441, the pixel block of a large area or size is advantageous from the point of the reliability of the stereo matching because of its increased number of pixels included in the block.
However, in case of using the pixel block of a large size, there is a likelihood that the position of a target pixel block from which a parallax is calculated is deviated from the actual coordinate position corresponding to the parallax calculated with respect to the pixel block, because, when the correlation of brightness between the paired pixel blocks is evaluated, the position of the identified pixel blocks on the comparison image is largely affected by a portion having a large brightness change. Accordingly, the pixel block having a large size produces erroneous correlations leading to a positional deviation of parallaxes. As a result, this positional deviation of parallaxes has a possibility of exacerbating the recognition accuracy of objects. In case of an object opposing to an axis of the camera, the recognition accuracy is not affected so much, however, in case of objects obliquely imaged like grounds, roads, the deviation of parallaxes has a serious effect leading to an erroneous recognition of grounds.
Further, under adverse image conditions such as rains, nighttime and the like, since the image has weaker contrasts than in fine weather, if the security of the stereo matching is a first priority, the pixel block having a large size is more advantageous. Under such situations as being able to obtain the security of the stereo matching, however, the small size pixel block is advantageous in consideration of the positional deviation of parallaxes. In prior arts, in processing the stereo matching, the size of the pixel block has been treated as unchanged in such a condition as neglecting either of these problems.